﻿@model CodeCamp.Models.EventMgmt.SponsorListViewModel
@{
    Layout = "~/Views/Shared/_LayoutWideSimple.cshtml";
    @* ViewBag.RegistrationUrl set in code - SetSharedViewBagProperties *@
    ViewBag.EventName = "";
    ViewBag.Title = "";
    if ((@Model != null) && (@Model.EventDisplayName != null))
    {
        ViewBag.Title = @Html.Encode(@Model.EventDisplayName + " | Sponsors");
        ViewBag.EventName = @Model.EventDisplayName;
    }
    else
    {
        ViewBag.Title = "Code Camp | Sponsors";
        ViewBag.EventName = "Code Camp";
    }
}

@section headaddon {
<style>
    table
    {
        border-collapse: collapse;
        border: solid 1px;
        margin: 0;
    }
    th
    {
        padding: 4px;
    }
    td 
    {
        padding: 4px;
    }
    #main-wide
    {
        min-height:400px;
    }
</style>
}

<h2 class="title">@ViewBag.Title</h2>

@Html.Partial("PartialViews/SponsorsListPartial", @Model)

@Html.ActionLink("Add Sponsor", "SponsorAdd")<br />

@section sidebar {
    <div id="subLinksContainer" class="widget rounded-10" style="text-align:left;">
    <h3>Event Mgmt</h3>
    <ul>
        <li>@Html.ActionLink("Mgmt Home", "Index", "EventMgmt", new { eventName = Model.EventShortName }, null)</li>
        <li>@Html.ActionLink("EMail", "Index", "Email", new { eventName = Model.EventShortName }, null)</li>
        <li>@Html.ActionLink("Logs", "List", "Logs", new { eventName = Model.EventShortName }, null)</li>
        <li>@Html.ActionLink("Presenters", "Presenters", "EventMgmt", new { eventName = Model.EventShortName }, null)</li>
        <li>@Html.ActionLink("Site Users", "SiteUsers", "EventMgmt", new { eventName = Model.EventShortName }, null)</li>
    </ul>
    </div>

    <div id="sponsorsContainer" class="widget rounded-10">

        <h3>Sponsors</h3>

        <ul class="sponsors" style="display:none;">
        @{
            if ((@Model == null)  || (Model.Sponsors.Count == 0))
            {
                <li>&nbsp;</li>
            }
            else
            {
                //no @ needed here now that the <li></li> are inside foreach curley braces
                foreach(var sponsor in @Model.Sponsors)
                {
                <li>
                <a href="@Html.Encode(@sponsor.Url)" target="_blank">
                    <img src="@Html.Encode(@sponsor.ImageUrl)" alt="@Html.Encode(@sponsor.Name)" 
                    width="@Html.Encode(@sponsor.ImageWidth)" height="@Html.Encode(@sponsor.ImageHeight)"  border="0" />
                </a>
                </li>
                }
            }
        }
        </ul>

    </div>

}